package com.blb.community.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.community.entity.ZyCommunityInteraction;
import com.blb.community.entity.vo.CommunityInteractionVO;
import com.blb.community.entity.vo.ZyCommunityInteractionVo;
import com.blb.community.mapper.ZyCommunityInteractionMapper;
import com.blb.community.service.IZyCommunityInteractionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 社区互动表 服务实现类
 * </p>
 *
 * @author 帅帅
 * @since 2022-07-02
 */
@Service
public class ZyCommunityInteractionServiceImpl extends ServiceImpl<ZyCommunityInteractionMapper, ZyCommunityInteraction> implements IZyCommunityInteractionService {

    @Autowired
    private ZyCommunityInteractionMapper zyCommunityInteractionMapper;

    @Override
    public IPage<ZyCommunityInteractionVo> getAllCommentsPage(Long current, Long size) {
        return zyCommunityInteractionMapper.getAllCommentsPage(new Page<>(current,size));
    }

    @Override
    public List<ZyCommunityInteractionVo> getAllComments() {
        return zyCommunityInteractionMapper.getAllCommentsPage();
    }

    /**
     * 小区互动分页查询
     * @param page
     * @return
     */
    @Override
    public IPage<CommunityInteractionVO> getInteractionPage(CommunityInteractionVO communityInteractionVO, IPage<CommunityInteractionVO> page) {

        return zyCommunityInteractionMapper.getInteractionPage(communityInteractionVO,page);
    }

    @Override
    public void delInteraction(Long id) {
        zyCommunityInteractionMapper.delInteraction(id);
    }
}
